{% if groups['namenodes']|count > 1 %}
export SPARK_HISTORY_SERVER_LOG_DIR=hdfs://{{ cluster_name }}{{ spark_history_server_dir }}
{% else %}
export SPARK_HISTORY_SERVER_LOG_DIR=hdfs://{{ groups['namenodes'][0] }}:8020{{ spark_history_server_dir }}
{% endif %}
export SPARK_HISTORY_OPTS="$SPARK_HISTORY_OPTS -Dspark.history.fs.logDirectory=${SPARK_HISTORY_SERVER_LOG_DIR}"
export SPARK_CONF_DIR=/etc/spark/conf
